-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(x/group): update supported flags #22229
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request focus on enhancing the command-line interface (CLI) for group transactions within the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
📒 Files selected for processing (2)
- x/group/client/cli/tx.go (1 hunks)
- x/group/client/cli/util.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
x/group/client/cli/tx.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.x/group/client/cli/util.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
@@ -55,7 +55,7 @@ func parseMembers(membersFile string) ([]group.MemberRequest, error) { | |||
|
|||
func execFromString(execStr string) group.Exec { | |||
exec := group.Exec_EXEC_UNSPECIFIED | |||
if execStr == ExecTry { | |||
if execStr == ExecTry || execStr == "1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the condition for "1" to align with PR objectives
The current change contradicts the PR objectives and the linked issue #22220. Adding the condition execStr == "1"
allows "1" as a valid input for immediate execution, which is precisely what we're trying to correct.
Please modify the function to only accept "try" (case-insensitive) for immediate execution. Here's the suggested change:
-if execStr == ExecTry || execStr == "1" {
+if strings.EqualFold(execStr, ExecTry) {
exec = group.Exec_EXEC_TRY
}
Also, consider adding a comment explaining the accepted values:
// execFromString converts a string to group.Exec
// Only "try" (case-insensitive) is accepted for immediate execution
// All other values result in group.Exec_EXEC_UNSPECIFIED
func execFromString(execStr string) group.Exec {
// ... (rest of the function)
}
This change ensures that only "try" (case-insensitive) is accepted for immediate execution, aligning with the PR objectives and preventing potential confusion or bugs.
@@ -534,7 +534,7 @@ metadata example: | |||
}, | |||
} | |||
|
|||
cmd.Flags().String(FlagExec, "", "Set to 1 to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") | |||
cmd.Flags().String(FlagExec, "", "Set to 1 or 'try' to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the help string to accurately reflect the allowed value for FlagExec
.
The help string suggests that both 1
and 'try'
can be used to execute the proposal immediately after creation. However, according to the PR objectives and linked issue #22220, only 'try'
is the valid value. Using 1
does not trigger immediate execution and can lead to confusion for users. Please update the help string to reflect this accurately.
Apply this diff to correct the help string:
-cmd.Flags().String(FlagExec, "", "Set to 1 or 'try' to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)")
+cmd.Flags().String(FlagExec, "", "Set to 'try' to execute proposal immediately after creation (proposers signatures are considered as Yes votes)")
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
cmd.Flags().String(FlagExec, "", "Set to 1 or 'try' to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") | |
cmd.Flags().String(FlagExec, "", "Set to 'try' to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") |
(cherry picked from commit 8ad2081)
(cherry picked from commit 8ad2081)
(cherry picked from commit 8ad2081)
Description
Closes: #22220
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
Bug Fixes
Documentation